import useUserStore from "@/store/modules/user";

// 所有权限都存在才返回true
export default (permissions: string[]): boolean => {
    // 数组去重
    const uniquePermissions = [...new Set(permissions)];
    const userStore = useUserStore();
    return uniquePermissions.every(permission => {
        return userStore.userInfo.roles.includes(permission);
    }) || false;
}